<?php

namespace App\Models;

use App\Common\Constant\Params;
use Illuminate\Database\Eloquent\Model;

class OrderReplenish extends BaseModel
{

    protected $table = 'orders_replenish';

    const CREATED_AT = 'add_time';
    const UPDATED_AT = 'upd_time';

    protected $dateFormat = 'U';

    protected $fillable = [
        'order_number',
        'order_id',
        'replenish_amount',
        'replenish_reason',
        'pay_time',
    ];

    protected $casts = [
        'replenish_amount' => 'double',
        'pay_time' => 'datetime',
    ];

    protected $touches = ['order'];

    public function order(){
        return $this->belongsTo(Order::class,'order_id');
    }

}
